<?php
class GeoView{
	protected static $_instance;

	private function __construct(){}
	private function __clone(){}
	public static function inst(){
	  if( null===self::$_instance ){
	    self::$_instance=new self();
		}
		return self::$_instance;
	}

	public static function error($msg){
	  return $msg;
	}

	public function getPointsNear($data){ //Miles 2 kilomiters
	  for( $i=0, $cnt=count($data); $i<$cnt; $i++ ) if(!empty($data[$i]['p_distance']))$data[$i]['p_distance']=round($data[$i]['p_distance']*1.609344, 1);
		return $data;
	}

	public function getNetworksNear($data){ //Miles 2 kilomiters
	  for( $i=0, $cnt=count($data); $i<$cnt; $i++ ) if(!empty($data[$i]['p_distance']))$data[$i]['n_distance']=round($data[$i]['n_distance']*1.609344, 1);;
		return $data;
	}
}
?>